/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "continent")
@NamedQueries({
    @NamedQuery(name = "Continent.findAll", query = "SELECT c FROM Continent c"),
    @NamedQuery(name = "Continent.findByIdcontinent", query = "SELECT c FROM Continent c WHERE c.idcontinent = :idcontinent"),
    @NamedQuery(name = "Continent.findByContinent", query = "SELECT c FROM Continent c WHERE c.continent = :continent")})
public class Continent implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idcontinent")
    private Integer idcontinent;
    @Basic(optional = false)
    @Column(name = "continent")
    private String continent;
    @OneToMany(mappedBy = "continent", fetch = FetchType.LAZY)
    private List<Localityelement> localityelementList;

    public Continent() {
    }

    public Continent(Integer idcontinent) {
        this.idcontinent = idcontinent;
    }

    public Continent(Integer idcontinent, String continent) {
        this.idcontinent = idcontinent;
        this.continent = continent;
    }

    public Integer getIdcontinent() {
        return idcontinent;
    }

    public void setIdcontinent(Integer idcontinent) {
        this.idcontinent = idcontinent;
    }

    public String getContinent() {
        return continent;
    }

    public void setContinent(String continent) {
        this.continent = continent;
    }

    public List<Localityelement> getLocalityelementList() {
        return localityelementList;
    }

    public void setLocalityelementList(List<Localityelement> localityelementList) {
        this.localityelementList = localityelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idcontinent != null ? idcontinent.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Continent)) {
            return false;
        }
        Continent other = (Continent) object;
        if ((this.idcontinent == null && other.idcontinent != null) || (this.idcontinent != null && !this.idcontinent.equals(other.idcontinent))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Continent[idcontinent=" + idcontinent + "]";
    }

}
